import request from '@/utils/request'

// 管理员查询服务案例的记录
export const GetIndustrialService = (page, pageSize) => {
  return request({
    url: '/v1/departmentWork/industrialService/',
    method: 'get',
    params: { page, page_size: pageSize },
  })
}

// 管理员删除服务案例记录
export const DelIndustrialService = (rid) => {
  return request({
    url: '/v1/departmentWork/industrialService/',
    method: 'delete',
    params: { rid },
  })
}

// 查询记录评级
export const GetLevelIndustrialService = (date, level, page, pageSize) => {
  return request({
    url: '/v1/departmentWork/industrialService/level/',
    method: 'get',
    params: { date, level, page, page_size: pageSize },
  })
}

// 评级服务案例
export const LevelIndustrialService = (data) => {
  return request({
    url: '/v1/departmentWork/industrialService/level/',
    method: 'put',
    data,
  })
}

// --------------------------------------------------------------------

// 保存产业服务案例的记录
export const SaveMyIndustrialService = (data) => {
  return request({
    url: '/v1/departmentWork/industrialService/my/',
    method: 'post',
    data,
  })
}

// 查询产业服务案例的记录
export const GetMyIndustrialService = (page, pageSize) => {
  return request({
    url: '/v1/departmentWork/industrialService/my/',
    method: 'get',
    params: { page, page_size: pageSize },
  })
}

// 用户删除自己的服务案例记录
export const DelMyIndustrialService = (rid) => {
  return request({
    url: '/v1/departmentWork/industrialService/my/',
    method: 'delete',
    params: { rid },
  })
}

// --------------------------------------------------------------------

// 统计数据
export const StatisticsIndustrialServiceRecord = (start, end, st) => {
  return request({
    url: '/v1/departmentWork/industrialService/statistics/',
    method: 'get',
    params: { start, end, st },
  })
}
